/*
 * @Author: your name
 * @Date: 2021-12-04 08:37:32
 * @LastEditTime: 2021-12-04 09:08:46
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /carbon/project/carbon/src/router/rouest.js
 */
import "nprogress/nprogress.css"
import { start, done, configure } from "nprogress"
configure({
    trickleSpeed: 20,
})

function delay(duration) {
    return new Promise((resolve) => {
        setTimeout(() => {
            resolve()
        }, duration)
    })
}
function getPageComponent(pageCompResolver) {
    return async () => {
        start()
        if (process.env.NODE_ENV === "development") {
            await delay(2000)
        }
        const comp = await pageCompResolver()
        done()
        return comp
    }
}





export default [
    {
        name: "Home",
        path: "/",
        component: getPageComponent(() =>
            import(/* webpackChunkName: "home" */ "../views/Home/index.vue")
        )
    },
    {
        name: "Wallet",
        path: "/wallet",
        component: getPageComponent(() =>
            import(/* webpackChunkName: "wallet" */ "../views/Wallet/index.vue")
        ),
    },
    {
        name:"TokenInfo",
        path:"/tokenInfo/:id",
        component:getPageComponent(() =>
            import(/* webpackChunkName: "wallet" */ "../views/TokenInfo/index.vue")
        )
    },
    {
        name: "CarbonFp",
        path: "/carbonFp",
        component: getPageComponent(() =>
            import(/* webpackChunkName: "carbonFp" */ "../views/CarbonFp/index.vue")
        )
    },
    {
        name: "League",
        path: "/league",
        component: getPageComponent(() =>
            import(/* webpackChunkName: "carbonFp" */ "../views/League/index.vue")
        ),
        children: [
            {
                path: 'basicInfo',
                name: 'BasicInfo',
                component:getPageComponent(() =>
                import(/* webpackChunkName: "carbonFp" */ "../views/League/components/leagueBasicInfo/leagueBasicInfo")
                )
            },
            {
                path: 'carbonCredits',
                name: 'CarbonCredits',
                component:getPageComponent(() =>
                import(/* webpackChunkName: "carbonFp" */ "../views/League/components/carbonCredits/carbonCredits")
                )
            },
            {
                path: 'leagueInfo',
                name: 'LeagueInfo',
                component:getPageComponent(() =>
                    import(/* webpackChunkName: "carbonFp" */ "../views/League/components/leagueInfo/leagueInfo")
                )
            },
            {
                path: 'managerFunction',
                name: 'ManagerFunction',
                component:getPageComponent(() =>
                    import(/* webpackChunkName: "carbonFp" */ "../views/League/components/specialFunction/managerFunction")
                )
            }
        ]
    }
]
